<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName"
    value="${message(code: 'workflowStage.label', default: 'workflowStage')}"/>
    <title>工作流阶段</title>
</head>

<body>
    <div class="main-body">
        <div class="page-wrapper">
            <div class="page-header">
                <div class="page-header-title">
                    <h4>工作流阶段详情</h4>
                </div>
                <div class="page-header-breadcrumb">
                    <ul class="breadcrumb-title">
                        <li class="breadcrumb-item">
                            <a href="/salesDashboard/index">
                                <i class="icofont icofont-home"></i>
                            </a>
                        </li>
                        <li class="breadcrumb-item">
                            <g:link controller="workflow" action="show" id="${this.workflowStage?.workflow?.id}">工作流</g:link>
                        </li>
                        <li class="breadcrumb-item">工作流阶段详情</li>
                    </ul>
                </div>
            </div>

            <div class="page-body">
                <g:if test="${flash.message}">
                <div class="message alert alert-info" role="status">${flash.message}
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">×</span></button>
                    </div>
                </g:if>
                <div class="card">
                    <div class="card-header">
                        <h5>工作流阶段详情</h5>

                        <div class="card-header-right">

                        
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>
                <div class="card-block">

                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">名称</label>

                        <div class="col-md-3">
                            <div class="form-control-static">${this.workflowStage?.name}</div>
                        </div>
                        <label class="col-md-2 col-form-label">执行次序</label>

                        <div class="col-md-3">
                            <div class="form-control-static">${this.workflowStage?.executionSequence}</div>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">是否回退</label>

                        <div class="col-md-3">
                            <div class="form-control-static">${this.workflowStage?.canReject}</div>
                        </div>
                        
                    </div>

                </div>


            </div>
            <div class="card">
                <div class="card-header">
                    <h5>约束条件</h5>

                    <div class="card-header-right">

                        <g:link controller="workflowCondition" action="create" 
                        params="[stage: this.workflowStage.id]" data-toggle="tooltip" data-placement="top" 
                        title="" data-original-title="新增">
                        <i class="icofont icofont-plus"></i>
                    </g:link>
                    <i class="icofont icofont-rounded-down"></i>
                    
                </div>
            </div>
            <div class="card-block dt-responsive">

                <div class="table-responsive">
                    <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">
                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                                <th>执行次序</th>
                                <th>组件</th>
                                <th>分支</th>
                                <th>描述</th>
                                <th width="8%">操作</th>
                            </thead>
                            <tbody>
                                <g:each in="${this.workflowConditions}">
                                <tr>

                                    <td>
                                        ${it?.executeSequence}
                                    </td>
                                    <td>
                                        ${it?.component?.name}
                                    </td>
                                    <td>
                                        ${it?.nextStage?.name}
                                    </td>
                                    <td>
                                        ${it?.message}
                                    </td>
                                    <td class="text-center">
                                        <g:link class="m-r-15 text-primary"
                                        controller="workflowCondition" action="edit"
                                        id="${it?.id}">
                                        <i class="icofont icofont-ui-edit"></i>
                                    </g:link>

                                    <g:form resource="${it}" class="inline" method="DELETE">
                                    <button class="deleteBtn text-danger" type="button">
                                        <i class="icofont icofont-trash"></i>
                                    </button>
                                </g:form>
                            </td>


                        </tr>

                    </g:each>
                </tbody>
            </table>

        </div>
    </div>

</div>
</div>

<div class="card">
    <div class="card-header">
        <h5>事件</h5>

        <div class="card-header-right">


            <g:link controller="workflowEvent" action="create"
            params="[stage: this.workflowStage.id]" data-toggle="tooltip" data-placement="top" 
            title="" data-original-title="新增">
            <i class="icofont icofont-plus"></i>
        </g:link>
        <i class="icofont icofont-rounded-down"></i>

    </div>
</div>
<div class="card-block dt-responsive">

    <div class="table-responsive">
        <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">
            <table class="table table-striped table-bordered table-hover">
                <thead>
                    <tr>
                        <g:sortableColumn property="executeSequence"
                        title="${message(code: 'opportuniryWorkflowEvent.executeSequence.label', default: '执行次序')}"/>
                        <g:sortableColumn property="isSynchronous"
                        title="${message(code: 'opportuniryWorkflowEvent.isSynchronous.label', default: '同步执行')}"/>

                        <g:sortableColumn property="component"
                        title="${message(code: 'opportuniryWorkflowEvent.component.label', default: '组件')}"/>

                        <g:sortableColumn width="8%" property="operation" class="text-center" title="操作"/>
                    </tr>
                </thead>
                <tbody>
                    <g:each in="${this.workflowEvents}">
                    <tr>
                        <td>
                            ${it?.executeSequence}
                        </td>
                        <td>
                            ${it?.isSynchronous}
                        </td>
                        <td>
                            ${it?.component?.name}
                        </td>

                        <td class="text-center">
                            <g:link class="m-r-15 text-primary"
                            controller="workflowEvent" action="edit"
                            id="${it?.id}">
                            <i class="icofont icofont-ui-edit"></i>
                        </g:link>

                        <g:form resource="${it}" class="inline" method="DELETE">
                        <button class="deleteBtn text-danger" type="button">
                            <i class="icofont icofont-trash"></i>
                        </button>
                    </g:form>


                </td>

            </tr>

        </g:each>
    </tbody>
</table>

</div>
</div>

</div>
</div>
<div class="card">
    <div class="card-header">
        <h5>权限</h5>

        <div class="card-header-right">

            <g:link controller="workflowUser" action="create"
            params="[stage: this.workflowStage.id]" data-toggle="tooltip" data-placement="top" 
            title="" data-original-title="新增">
            <i class="icofont icofont-plus"></i>
        </g:link>
        <i class="icofont icofont-rounded-down"></i>

    </div>
</div>
<div class="card-block dt-responsive">

    <div class="table-responsive">
        <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">
            <table class="table table-striped table-bordered table-hover">
                <thead>
                    <tr>
                        <g:sortableColumn property="position"
                        title="岗位"/>
                        <g:sortableColumn property="authority"
                        title="权限"/>
                        <g:sortableColumn width="8%" class="text-center" property="operation"
                        title="操作"/>
                    </tr>
                </thead>
                <tbody>
                    <g:each in="${this.workflowUsers}">
                    <tr>
                        <td>${it?.position?.name}</td>
                        <td>${it?.authority?.name}</td>
                        <td class="text-center">
                            <g:link class="m-r-15 text-primary"
                            controller="workflowUser" action="edit"
                            id="${it?.id}">
                            <i class="icofont icofont-ui-edit"></i>
                        </g:link>

                        <g:form resource="${it}" class="inline" method="DELETE">
                        <button class="deleteBtn text-danger" type="button">
                            <i class="icofont icofont-trash"></i>
                        </button>
                    </g:form>

                </td>
            </tr>
        </g:each>
    </tbody>
</table>

</div>
</div>

</div>
</div>
<div class="card">
    <div class="card-header">
        <h5>消息</h5>

        <div class="card-header-right">

            <g:link controller="workflowNotification" action="create"
            params="[stage: this.workflowStage.id]" data-toggle="tooltip" data-placement="top" 
            title="" data-original-title="新增">
            <i class="icofont icofont-plus"></i>
        </g:link>
        <i class="icofont icofont-rounded-down"></i>

    </div>
</div>
<div class="card-block dt-responsive">

    <div class="table-responsive">
        <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">
            <table class="table table-striped table-bordered table-hover">
                <thead>
                    <tr>
                        <g:sortableColumn property="position"
                        title="岗位"/>
                        <g:sortableColumn property="messageTemplate"
                        title="${message(code: 'workflowNotification.messageTemplate.label', default: '消息模板')}"/>
                        <g:sortableColumn property="toManager"
                        title="${message(code: 'workflowNotification.toManager.label', default: '推送主管')}"/>
                        <g:sortableColumn property="cellphone"
                        title="${message(code: 'workflowNotification.cellphone.label', default: '手机号')}"/>
                        <g:sortableColumn width="8%" class="text-center" property="operation"
                        title="操作"/>
                    </tr>
                </thead>
                <tbody>
                    <g:each in="${this.workflowNotifications}">
                    <tr>
                        <td>${it?.position?.name}</td>
                        <td>${it?.messageTemplate?.text}</td>
                        <td>${it?.toManager}</td>
                        <td>
                          <pre>
                              <code>${it?.cellphone}</code>
                          </pre>
                      </td>
                      <td class="text-center">
                        <g:link class="m-r-15 text-primary"
                        controller="workflowNotification" action="edit" 
                        id="${it?.id}">
                        <i class="icofont icofont-ui-edit"></i>
                    </g:link>

                    <g:form resource="${it}" class="inline" method="DELETE">
                    <button class="deleteBtn text-danger" type="button">
                        <i class="icofont icofont-trash"></i>
                    </button>
                </g:form>

            </td>
        </tr>
    </g:each>
</tbody>
</table>


</div>
</div>

</div>
</div>

</div>
</div>
</div>
</body>
</html>
